﻿<%@ Page CodeFileBaseClass="AliCMS.Lib.SystemPageBase" %>
<ali:List ID="Module" Object="Module" />
<script language="c#" runat="server">
protected string GetModuleNamespace(object moduleID)
{
	DataRow[] rows = Module.Select(Alias.Module.ID + "='" + moduleID + "'");
	if (rows.Length == 0)
		return String.Empty;
	else
		return rows[0][Alias.Module.Namespace].ToString();
}
</script>
<section data-page="channel_add" data-title="添加栏目" data-lang="<%=ContentLang%>">
	<dl class="path1">
		<dt><span>您的位置：</span>添加栏目</dt>
		<dd>
			<select data-class="<%=ContentLang%>Font" data-ali-widget="combo">
				<ali:List Object="Language" Source="Manager.Languages">
					<ali:Record>
						<%If Convert.ToString(Ab) == ContentLang%>
							<option value="<%=Ab%>" selected><%=[AliCMS.SystemModule.Alias.Language.Name + PageLang]%></option>
						<%Else%>
							<option value="<%=Ab%>"><%=[AliCMS.SystemModule.Alias.Language.Name + PageLang]%></option>
						<%EndIf%>
					</ali:Record>
				</ali:List>
			</select>
		</dd>
	</dl>
	<form action="" class="post">
		<div class="post-body">
			<div class="ali-tabs" data-event="click">
				<div class="ali-tabs-header">
					<div class="ali-tabs-nav-container">
						<ul>
							<li><a href="list.aspx?Lang=<%=ContentLang%>" target="ali-navtab">栏目列表</a></li>
							<li class="ali-active"><a>添加栏目</a></li>
						</ul>				
					</div>
				</div>
				<div class="ali-tabs-body">
					<div class="ali-tabs-panel"></div>
					<div class="ali-tabs-panel">
						<table class="post-table margin2">
							<tr>
								<th>类型：</th>
								<td>
									<label><input type="radio" name="Type" value="Functional" checked>功能栏目</label>
									<label><input type="radio" name="Type" value="NonFunctional">非功能栏目</label>
									<label><input type="radio" name="Type" value="OuterLink">外部链接</label>
								</td>
							</tr>
							<tr>
								<th>实例：</th>
								<td>
									<ali:List Object="Instance" Source="Instance" Sort="InnerID DESC">
										<select name="InstanceID" data-class="<%=ContentLang%>Font" data-ali-widget="combo">
											<ali:Record>
												<option value="<%=ID%>" data-module-id="<%=GetModuleNamespace(ModuleID)%>"><%=Name%></option>
											</ali:Record>
										</select>
									</ali:List>
								</td>
							</tr>
							<tr>
								<th>父栏目：</th>
								<td>
									<select name="ParentID" data-class="<%=ContentLang%>Font" data-ali-widget="combo" data-tree="true" data-root="">
										<option value="" data-item="" data-parent="">未指定</option>
										<ali:Tree Object="Channel" Condition="Lang=ContentLang">
											<ali:Record>
												<option value="<%=ID%>" data-item="<%=InnerID%>" data-parent="<%=ParentInnerID%>"><%=Name%></option>
												<%=ChildRecords%>
											</ali:Record>
										</ali:Tree>
									</select>
								</td>
							</tr>
							<tr>
								<th>名称：</th>
								<td><input type="text" name="Name" size="50" maxlength="150" class="ali-input <%=ContentLang%>Font"></td>
							</tr>
							<tr>
								<th>路径：</th>
								<td><input type="text" name="Path" size="50" maxlength="255" class="ali-input"><p>首页，则留空。其它必须以斜杠（/）结尾，路经不能重复！<br>可以包含正则表达式，格式：{名称:正则表达式}</p></td>
							</tr>
							<tr>
								<th>模板：</th>
								<td>
									<img data-name="Thumbnail" alt="预览" style="float:left;margin:5px;width:50px;height:50px">
									<select name="TemplatePath" data-ali-widget="combo"></select><br><br>
									<select name="SkinPath" data-ali-widget="combo"></select>
									<input type="hidden" name="TemplateLang" value="<%=ContentLang%>">
								</td>
							</tr>
							<tr>
								<th>是否动态模板：</th>
								<td>
									<label><input type="radio" name="IsDynamicTemplate" value="true">是</label>
									<label><input type="radio" name="IsDynamicTemplate" value="false" checked>否</label>
									<ol style="display:none">
										<li>如果是动态模板，并且栏目路径中没有正则表达式，则设置name为ID，value为栏目路径后的第一个目录名称。</li>
										<li>如果是动态模板，并且栏目路径中包含正则表达式，则设置name为正则名称，value为正则匹配值。</li>
										<li>动态模板实例所属的模块的InstanceConfig对象必须包含GetDynamicTemplate的函数。</li>
									</ol>
								</td>
							</tr>
							<tr style="display:none">
								<th>动态模板实例：</th>
								<td>
									<ali:List ID="Instance" Object="Instance" Sort="InnerID DESC">
										<select name="DynamicInstanceID" data-class="<%=ContentLang%>Font" data-ali-widget="combo">
											<ali:Record>
												<option value="<%=ID%>"><%=Name%></option>
											</ali:Record>
										</select>
									</ali:List>
								</td>
							</tr>
							<tr>
								<th>智能翻译成：</th>
								<td>
									<select name="TranslateLang" data-class="<%=ContentLang%>Font" data-ali-widget="combo">
										<option value="">未指定</option>
									</select>
									<label style="display:none"><input type="checkbox" data-name="Match">匹配</label>
								</td>
							</tr>
							<tr>
								<th>是否生成：</th>
								<td>
									<label><input type="radio" name="Generate" value="true">是</label>
									<label><input type="radio" name="Generate" value="false" checked>否</label>
								</td>
							</tr>
							<tr style="display:none">
								<th>缓存时间：</th>
								<td><input type="text" name="Duration" value="86400" size="10" maxlength="10" class="ali-input"></td>
							</tr>
							<tr style="display:none">
								<th>GZip压缩：</th>
								<td>
									<label><input type="radio" name="GZipEnabled" value="true">启用</label>
									<label><input type="radio" name="GZipEnabled" value="false" checked>禁用</label>
								</td>
							</tr>
							<tr>
								<th>默认文档（首页）：</th>
								<td><input type="text" name="DefaultDocument" value="index" size="15" maxlength="50" class="ali-input"></td>
							</tr>
							<tr>
								<th>扩展名：</th>
								<td><input type="text" name="Extension" value=".aspx" size="10" maxlength="50" class="ali-input"></td>
							</tr>
							<tr>
								<th>域名：</th>
								<td>
									<input type="text" name="Domain" size="50" maxlength="150" class="ali-input"><br>
									以http://开头，以斜杠（/）结束，可以包含子目录。可绑定多个域名，多域名用“|”隔开。
								</td>
							</tr>
							<tr>
								<th>公告：</th>
								<td><textarea type="text" name="Notice" cols="60" rows="4" wrap="off" class="ali-input <%=ContentLang%>Font"></textarea></td>
							</tr>
							<tr>
								<th>脚注（版权信息）：</th>
								<td><textarea type="text" name="Footer" cols="60" rows="4" wrap="off" class="ali-input <%=ContentLang%>Font"></textarea></td>
							</tr>
							<tr>
								<th>统计代码：</th>
								<td><textarea type="text" name="StatCode" cols="60" rows="2" wrap="off" class="ali-input"></textarea></td>
							</tr>
							<tr>
								<th>栏目大标志：</th>
								<td>
									<input type="text" name="Logo" size="55" class="ali-input"><a class="ali-button ali-uploader">浏览...</a>
									<a href="" target="_blank"><img src="" height="22" alt="网站大标志"></a>
								</td>
							</tr>
							<tr>
								<th>栏目小标志：</th>
								<td>
									<input type="text" name="Link" size="55" class="ali-input"><a class="ali-button ali-uploader">浏览...</a>
									<a href="" target="_blank"><img src="" height="22" alt="网站小标志"></a>
								</td>
							</tr>
							<tr>
								<th>启用可视编辑：</th>
								<td>
									<label><input type="radio" name="VisualEdit" value="0" checked>禁用</label>
									<label><input type="radio" name="VisualEdit" value="1">静态</label>
									<label><input type="radio" name="VisualEdit" value="2">动态</label>
									<ol>
										<li>如果是动态，并且栏目路径中不包含正则表达式，则设置name为ID，value为栏目路径后的第一个目录名称。</li>
										<li>如果是动态，并且栏目路径中包含正则表达式，则设置name为正则名称，value为正则匹配值。</li>
										<li>栏目所属的模块的InstanceConfig对象必须包含GetVisualEditFolder(name, value, checkRight)的函数，它返回可视编辑目录路径。</li>
									</ol>
								</td>
							</tr>
							<tr>
								<th>栏目菜单：</th>
								<td>
									<label><input type="radio" name="EnableMenu" value="true" >启用</label>
									<label><input type="radio" name="EnableMenu" value="false" checked="checked" >禁用</label>
								</td>
							</tr>
							<tr style="display:none">
								<th>导航位置：</th>
								<td>
									<label><input type="radio" name="NavPosition" value="Top" checked="checked" >顶部</label>
									<label><input type="radio" name="NavPosition" value="Left" >左侧</label>
								</td>
							</tr>
							<tr style="display:none">
								<th>侧栏导航样式：</th>
								<td>
									<label><input type="radio" name="SideNavStyle" value="Tree" checked="checked" >树型</label>
									<label><input type="radio" name="SideNavStyle" value="Accordion">折叠型</label>
								</td>
							</tr>
							<tr style="display:none">
								<th>管理员角色：</th>
								<td><input type="text" name="AdminRole" size="30" class="ali-input"></td>
							</tr>
							<tr style="display:none">
								<th>辅助登陆路径：</th>
								<td><input type="text" name="LoginPath" size="30" class="ali-input"></td>
							</tr>
							<tr>
								<th>搜索引擎优化：</th>
								<td>
									页面关键字：<input type="text" name="MetaKeywords" size="40" maxlength="255" class="ali-input <%=ContentLang%>Font">
									页面描述：<input type="text" name="MetaDescription" size="40" maxlength="255" class="ali-input <%=ContentLang%>Font">
								</td>
							</tr>
						</table>
					</div>
				</div>
				<div class="ali-tabs-bottom"><b></b></div>
			</div>
		</div>
		<div class="post-footer"><button type="submit" class="ali-button">添 加</button><input type="hidden" name="PictureAllowedType" value="gif|jpg|jpeg|png|bmp|png"><input type="hidden" name="Lang" value="<%=ContentLang%>"></div>
	</form>
</section>